﻿Public Class ucSupplier
    Public Function ucValidateSupplier() As Boolean
        If txtSupplierName.Text = "" Or txtAddress.Text = "" Or txtEmail.Text = "" Or txtPhone.Text = "" Then
            MsgBox("Fields can't be blank!!")
            txtSupplierName.Focus()
            Return False
        End If
        If txtEmail.Text Like "*@[A-Z,a-z,0-9]*.*" Then
            MsgBox("Regular!!")
            Return True
        Else
            Beep()
            MsgBox("Don't regular!!")
            txtEmail.Text = ""
            txtEmail.Focus()
            Return False
        End If
        If txtPhone.Text Like "[0-9]" Then
            MsgBox("Regular!!!")
            Return True
        Else
            Beep()
            MsgBox("Don't Regular")
            txtPhone.Text = ""
            txtPhone.Focus()
            Return False
        End If
        Return True
    End Function
End Class
